<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>

        function shuru() {
         let  a=  prompt("请输入：")
            while(true){
                if(a<0||a>150||a!=parseInt(a)){
                  a=  prompt("请重新输入：")
                }else{
                    return a;
                }
            }

        }
        function jia(){
            let a=0;
            for(let i=0;i<5;i++){
             b=parseInt(shuru());
             a=a+b;
            }
            return a;
        }
    </script>
</head>
<body>
<input type="button" value="成绩" onclick="alert(jia())">
</body>
</html>